<?php

namespace App\Admin\Http\Middleware;

use Closure;
    
class Authenticate extends Middleware
{
    /**
     * 处理传入的请求
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!$this->getLoginUser($request)) {
            return redirect(admin_action('Auth\AuthController@getLogin'));
        }

        return $next($request);
    }
}
